package com.akkainaction.mailbox.config;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import com.akkainaction.mailbox.config.actor.MailBoxActor;
import com.typesafe.config.ConfigFactory;

public class TestDefaultMailbox {

    public static void main(String[] args) {
        ActorSystem system = ActorSystem.create("sys", ConfigFactory.load("default-akka-mailbox-config.conf"));
        ActorRef mailBoxActor = system.actorOf(Props.create(MailBoxActor.class), "mailBoxActor");
        for (int i = 0; i < 5; i++) {
            String msg = "hello mailbox" + i;
            System.out.println("发送了消息:" + msg);
            mailBoxActor.tell(msg, ActorRef.noSender());
        }
    }
}
